package com.pg.pojo;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class User {

    //主键,AUTO自增，必须在数据库里面也设置自增才行
    @TableId(type = IdType.AUTO)
    private int id;
    private String name;
    private String pwd;

    //插入和更新时候刷新，给字段填充内容
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @Version    //乐观锁注解
    private Integer version;

    @TableLogic     //逻辑删除
    private Integer deleted;

}
